<?php
//No direct access
defined('_JEXEC') or die('Restricted access');
?>
<div id="ownservices">
	<div id="mainmenuownservice"><?php echo MenuHelper::nav(); ?></div>
	<div id="mainownservice">
		<h3><?php echo $this->params->get('page_title'); ?></h3>
		<hr />
		<!-- toolbar -->
		<div id="toolbar">
			<a class="toolbar" onclick="javascript:submitbutton('add')" href="#">
				<span title="<?php echo JText::_('OWNSERVICE_NEW_CONDITION'); ?>" class="icon-32-new"></span>
				<?php echo JText::_('OWNSERVICE_NEW_CONDITION'); ?>
			</a>
		</div>	
		<div class="clear"> </div>
		<!-- form -->
		<form action="<?php echo JRoute::_('index.php?option=com_ownservice'); ?>" method="post" name="adminForm">

			<table class="adminlist" cellspacing="1">
				<tr>
					<td align="center" class="tablelist"><?php echo JHTML::_('grid.sort',  'OWNSERVICE_LEVELS', 'level', $this->lists['order_Dir'], $this->lists['order'] ); ?></td>
					<td align="center" class="tablelist"><?php echo JHTML::_('grid.sort',  'OWNSERVICE_CONDITION', 'p.condition', $this->lists['order_Dir'], $this->lists['order'] ); ?><br />(AUD)</td>
					<td align="center" class="tablelist"><?php echo JHTML::_('grid.sort',  'OWNSERVICE_POINT_EARN', 'p.pointearn', $this->lists['order_Dir'], $this->lists['order'] ); ?></td>
					<td align="center" class="tablelist"><?php echo JText::_('OWNSERVICE_SELECT_ACTION'); ?></td>
				</tr>
				<tbody>
					<?php
						$k = 0;
						$priceformat = OwnserviceHelper::getParams('price_format', '#,###.##');
						for($i=0,$n=count($this->rows);$i<$n;$i++)
						{
							$row 	= $this->rows[$i];
					?>
					<tr class="<?php echo "row$k"; ?>">
						<td class="inner_tablelist" align="center">
							<?php echo $row->level; ?>
						</td>
						<td class="inner_tablelist" align="center">
							<?php echo OwnserviceHelper::moneyFormat($priceformat, $row->condition); ?>
						</td>
						<td class="inner_tablelist" align="center">
							<?php echo $row->pointearn; ?>
						</td>
						<td class="inner_tablelist" align="center">
							<select class="inputbox" name="action" id="action" onChange="listTaskAction(<?php echo $row->id ?>,this.value);">
								<option value=""><?php echo JText::_('OWNSERVICE_PLEASE_SELECT'); ?></option>
								<option value="edit"><?php echo JText::_('OWNSERVICE_EDIT');?></option>
								<option value="delete"><?php echo JText::_('OWNSERVICE_DELETE');?></option>
							</select>
						</td>
					</tr>
					<?php $k = 1 - $k; } ?>
				</tbody>
			</table>
			<!-- hidden -->
			<div>
				<input type="hidden" name="option" value="com_ownservice" />
				<input type="hidden" name="id" value="" />
				<input type="hidden" name="task" value="" />
				<input type="hidden" name="Itemid" value="<?php echo JRequest::getVar('Itemid'); ?>" />
				<input type="hidden" name="controller" value="point" />
				<input type="hidden" name="view" value="points" />
				<input type="hidden" name="filter_order" value="<?php echo $this->lists['order']; ?>" />
				<input type="hidden" name="filter_order_Dir" value="<?php echo $this->lists['order_Dir']; ?>" />
				<?php echo JHTML::_( 'form.token' ); ?>
			</div>	
		</form>
	</div>
</div>